package com.diankangwo.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.diankangwo.dao.OnlinePayResultLogDAO;
import com.diankangwo.domain.OnlinePayResultLog;
import com.diankangwo.service.OnlinePayResultLogService;
import com.diankangwo.util.PageSupport;

@Service
public class OnlinePayResultLogServiceImpl implements OnlinePayResultLogService {
	
	@Autowired
	private OnlinePayResultLogDAO onlinePayResultLogDAO;

	@Override
	public void saveOrUpdate(OnlinePayResultLog t) {
		onlinePayResultLogDAO.saveOrUpdate(t);
	}

	@Override
	public void deleteById(Integer id) {
		onlinePayResultLogDAO.deleteById(id);
	}

	@Override
	public PageSupport<OnlinePayResultLog> findPagination(int pageNo, int pageSize) {
		return onlinePayResultLogDAO.findPagination(pageNo, pageSize);
	}

	@Override
	public OnlinePayResultLog findByNo(String no) {
		try {
			return onlinePayResultLogDAO.findByProperty("billNo", no).get(0);
		} catch (Exception e) {
			return null;
		}
	}

}
